<?php
class DefaultInstall4Action extends InstallAction
{
	public function __construct()
	{
		parent::__construct();
		$this->responseType = 'tpl';
		$this->layout = 'index';
	}
	
	public function execute()
	{
		if($this->context->post('setadmin')!='')
		{
			$name 			= $this->context->post('name');
			$password 		= $this->context->post('password');
			$code	 		= $this->context->post('code');
			
			if($name=='')
			{
				$this->data['err']	= '请输入管理员用户名';
				return;
			}
			
			if($password=='')
			{
				$this->data['err']	= '请输入管理员密码';
				return;
			}
			
			header('Location:'.C('LtUrl')->generate('Default','Install5',array('name'=>$name,'password'=>md5($password),'code'=>$code)));
		}
	}
}
